package com.itlong.cloud.paymenthub;

import com.itlong.cloud.POJO.DTO.property.PropertyCloudServiceCastMessagePageDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyCloudServiceCostSaveOrderDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyInvoiceInfoDTO;
import com.itlong.cloud.POJO.PO.PropertyCloudServiceCostOrderInfoPO;
import com.itlong.cloud.POJO.VO.property.PropertyCloudServiceCostPaymentByPageVO;
import com.itlong.cloud.POJO.VO.property.PropertyCloudServiceCostRecordByPageVO;
import com.itlong.cloud.utils.page.Page;
import com.itlong.cloud.utils.page.PageByVisitor;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * <desc>
 *     云服务费支付接口暴露
 * </desc>
 *
 * @createDate 2019/8/12
 */
@FeignClient(name = "payment-hub-service")
public interface IPropertyCloudServiceCostServiceClient {

    /**
     * <desc>
     *      获取云服务费的订单列表。
     * <desc/>
     *
     * @param  projectId 项目ID
     * @param  currentPage 当前页
     * @param  pageSize 页面大小
     * @param  feeStatus 查询条件 1待缴费 2全部
     * @param  orderColumn 排序条件
     * @param  orderRule 排序规则 ASC DESC
     * @return
     * @author Juguang.S
     * @createDate 2019-11-22
     */
    @PostMapping(path = "/pay/getOrderInfo")
    PageByVisitor<PropertyCloudServiceCostPaymentByPageVO> getOrderInfo(@RequestParam("projectId") String projectId,
                                                                        @RequestParam(value = "currentPage",required = false) String currentPage,
                                                                        @RequestParam(value = "pageSize",required = false) String pageSize,
                                                                        @RequestParam("feeStatus") String feeStatus,
                                                                        @RequestParam(value = "orderId",required = false) String orderId,
                                                                        @RequestParam(value = "orderColumn",required = false) String orderColumn,
                                                                        @RequestParam(value = "orderRule",required = false) String orderRule) throws Exception;

    /**
     * <desc>
     *      修改线下银行支付订单
     * <desc/>
     *
     * @param  orderDTO 订单
     * @return
     * @author Juguang.S
     * @createDate 2019/8/12
     */
    @PostMapping(path = "/pay/saveCloudServiceOrder")
    String saveOrder(@RequestBody PropertyCloudServiceCostSaveOrderDTO orderDTO) throws Exception;

    /**
     * <desc>
     *      获取物业云服务费续费记录分页信息。
     * <desc/>
     *
     * @param  pageDTO 请求参数
     * @return
     * @author Juguang.S
     * @createDate 2019-08-12
     */
    @PostMapping(path = "/pay/getPaymentRecordByPage")
    Page<PropertyCloudServiceCostRecordByPageVO> getPaymentRecordByPage(@RequestBody PropertyCloudServiceCastMessagePageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      检测是否还有未支付的结下账单
     * <desc/>
     *
     * @param  projectId 项目编号
     * @return
     * @author Juguang.S
     * @createDate 2019/8/21
     */
    @PostMapping(path = "/pay/getIsBankPayOrder")
    Integer getIsBankPayOrder(@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      保存物业发票信息。
     * <desc/>
     *
     * @param  dto 物业发票信息
     * @return
     * @author Juguang.S
     * @createDate 2019-11-22
     */
    @PostMapping(path = "/pay/addInvoiceInfo")
    Integer addInvoiceInfo(@RequestBody PropertyInvoiceInfoDTO dto) throws Exception;

    /**
     * <desc>
     *      根据订单ID查询订单金额及支付状态
     * <desc/>
     *
     * @param  orderId 订单Id
     * @return
     * @author Juguang.S
     * @createDate 2019/11/25
     */
    @PostMapping(path = "/pay/getOrderAmount")
    PropertyCloudServiceCostOrderInfoPO getOrderAmount(@RequestParam(value = "orderId",required = false) String orderId);

}
